CREATE TABLE `<?php echo $table ?>` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
<?php foreach ($fields as $f) : ?>
`<?php echo $f['name'] ?>` <?php echo $f['type'] ?> <?php echo ($f['null'] ? 'NULL':'NOT NULL') ?>,
<?php endforeach; ?>
`created_at` DATETIME NOT NULL ,
`updated_at` DATETIME NOT NULL
<?php foreach ($fields as $f) : ?>
	<?php if ($f['uniq']):?>
, UNIQUE (`<?php echo $f['name'] ?>`)
	<?php endif; ?>
<?php endforeach; ?>
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;